Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

336
Vistas
Why unable to resolve module specifier "firebase/app"

My JS Code goes as:

import { initializeApp } from "firebase/app";


const firebaseConfig = {
   //config object
  };

 
const app = initializeApp(firebaseConfig);

Im getting this error since a very long time and would like someone to please look into it:

Failed to resolve module specifier "firebase/app". Relative references must start with either "/", "./", or "../".

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Did you has been followed the steps from the official docs?

  1. Step 1: Create a Firebase project and register your app
  2. Step 2: Install the SDK and initialize Firebase

This page describes setup instructions for version 9 of the Firebase JS SDK, which uses a JavaScript Module format.

This workflow uses npm and requires module bundlers or JavaScript framework tooling because the v9 SDK is optimized to work with module bundlers to eliminate unused code (tree-shaking) and decrease SDK size.

2.a. Install Firebase using npm

npm install firebase

2.b. Initialize Firebase in your app and create a Firebase App object

import { initializeApp } from 'firebase/app';

// TODO: Replace the following with your app's Firebase project configuration
const firebaseConfig = {
  //...
};

const app = initializeApp(firebaseConfig);
  1. Access Firebase in your app

Firebase services (like Cloud Firestore, Authentication, Realtime Database, Remote Config, and more) are available to import within individual sub-packages.

The example below shows how you could use the Cloud Firestore Lite SDK to retrieve a list of data.

import { initializeApp } from 'firebase/app';
import { getFirestore, collection, getDocs } from 'firebase/firestore/lite';
// Follow this pattern to import other Firebase services
// import { } from 'firebase/<service>';

// TODO: Replace the following with your app's Firebase project configuration
const firebaseConfig = {
  //...
};

const app = initializeApp(firebaseConfig);
const db = getFirestore(app);

// Get a list of cities from your database
async function getCities(db) {
  const citiesCol = collection(db, 'cities');
  const citySnapshot = await getDocs(citiesCol);
  const cityList = citySnapshot.docs.map(doc => doc.data());
  return cityList;
}

You could refer my answer to the official link below

https://firebase.google.com/docs/web/setup

Hopefully can help you.

about 4 years ago · Juan Pablo Isaza Denunciar

0

Finally I got my issue resolved by using the following method to import functions :

import { function } from 'https://www.gstatic.com/firebasejs/9.6.3/firebase-SERVICE.js'

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda